package com.pg_chat.controller;

import com.pg_chat.model.Constant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("")
public class LogOutController {
    private final Logger log = LoggerFactory.getLogger(this.getClass());

    @RequestMapping("/logOut")
    public String logOut(HttpSession session){
        if(!(session.getAttribute(Constant.GLOBAL_USER) == null))
            session.removeAttribute(Constant.GLOBAL_USER);
        return "/login";
    }


}
